<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <title>会员资料</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">     
    <meta content="yes" name="apple-mobile-web-app-capable">     
    <meta content="black" name="apple-mobile-web-app-status-bar-style">     
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" type="text/css" href="/H5/css/sm.min.css" />
    <link rel="stylesheet" type="text/css" href="/H5/css/reset.css?v=1" />
    <link rel="stylesheet" href="/H5/light7.min.css">
    <link rel="stylesheet" href="/H5/public.css">
    <link rel="stylesheet" type="text/css" href="/H5/user.css">
</head>            
<body>
	<div class="page-group ms-controller" :controller="member">
        <div class="page page-current" style="background: #efeff4">
            <header class="bar bar-nav">
              	<a class="icon icon-left pull-left" href="javascript:window.history.go(-1);"></a>
              	<a class="icon icon-home pull-right" href="/H5"></a>
              	<h1 class="title">会员资料</h1>
            </header>

            <div class="content visibility" style="background-image: url('/H5/images/memberCenter_03.jpg');background-size: cover;background-repeat: no-repeat">
    			<div class="list-block" style="margin: 0">
                    <div style="background-image: url('/H5/images/menberCenter_04.jpg');background-size: 100% 100%;background-repeat: no-repeat;height: 7rem;padding-top:1rem; "><div class="portrait"><a href="javascript:;"><img style="box-shadow: 0 0 12px 6px #0000003b;" :attr="{'src': @data.avatar_url}" style="width: 70px;height: 70px;" /></a></div></div>
                    <ul class="block-ul" style="background-color: rgba(255,255,255,0.61)">
                        <li id="qrcode" class="item-content" :on-click="@jump('/H5/qrcode')">
                            <div class="item-inner">
                                <div class="item-title">我的二维码</div>
                            </div>
                        </li>
                        <li class="item-content" :if="@data.username">
                            <div class="item-inner">
                                <div class="item-title">登录账号</div>
                                <div class="item-after">{{@data.username}}</div>
                            </div>
                        </li>

                        <li class="item-content" :if="@data.level_text">
                            <div class="item-inner">
                                <div class="item-title">会员级别</div>
                                <div class="item-after">{{@data.level_text}}</div>
                            </div>
                        </li>

                        <li class="item-content" >
                            <div class="item-inner">
                                <div class="item-title">账户余额</div>
                                <div class="item-after">{{@data.balance}}</div>
                            </div>
                        </li>

                        <li class="item-content" >
                            <div class="item-inner">
                                <div class="item-title">预计收益</div>
                                <div class="item-after">{{@data.yuji_money}}</div>
                            </div>
                        </li>

                        <li class="item-content" >
                            <div class="item-inner">
                                <div class="item-title">总佣金</div>
                                <div class="item-after">{{@data.total_money}}</div>
                            </div>
                        </li>


                    </ul>
    			</div>
                <div class="list-block">
                    <ul class="gray" style="background-color: rgba(255,255,255,0.61)">

                        <li class="item-content" :on-click="@jump('/H5/chongzhi')">
                            <div class="item-inner">
                                <div class="item-title">充值</div>
                            </div>
                        </li>

                        <li class="item-content" :on-click="@jump('/H5/commissionlog')">
                            <div class="item-inner">
                                <div class="item-title">我的佣金</div>
                            </div>
                        </li>

                        <li class="item-content" :on-click="@jump('/H5/myshare')">
                            <div class="item-inner">
                                <div class="item-title">分享顾客</div>
                            </div>
                        </li>

                        <li class="item-content" :on-click="@jump('/H5/finance')">
                            <div class="item-inner">
                                <div class="item-title">财务管理</div>
                            </div>
                        </li>

                        <li class="item-content" :on-click="@jump('/H5/password?type=1')">
	                        <div class="item-inner">
	                          	<div class="item-title">修改密码</div>
	                        </div>
                      	</li>
                      	<li class="item-content" :on-click="@jump('/H5/memberperfect')">
                        	<div class="item-inner">
                          		<div class="item-title">完善会员资料</div>
                        	</div>
                      	</li>
                      	<li class="item-content" :on-click="@jump('/H5/addresslist')">
                        	<div class="item-inner">
                          		<div class="item-title">管理收货地址</div>
                        	</div>
                      	</li>
                        <li id="wx_login" class="item-content" :on-click="@logout">
                            <div class="item-inner">
                                <div class="item-title">退出登录</div>
                            </div>
                          </li>
                    </ul>
    			</div>
            </div>
        </div>
    </div>
<script type='text/javascript' src='/H5/js/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/avalon.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/simpleStorage.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/mall.js?v=10' charset='utf-8'></script>
<script>
	var member = avalon.define({
		$id: "member",
		data: {},
    message: 0,
		map: {
			total_contribution:"贡献值",
      username: "登录账号",
      real_name: "真实姓名",
      nickname: "会员昵称",
      born: "出生日期",
      level_text:"会员级别",
      id_no: "身份证号  ",
      mobile: "手机号码",
      area_label: "所在地区",
      address: "详细地址",
      email: "会员邮箱",
      bank_type_label: "开户行",
      bank_no: "银行卡号",
		},
		filter: function(e, k){
			if( e && member.map[k] ){
        console.log( e, k )
				return e 
			}
		},
		jump: function( url ){
			window.location.href = url;
		},
    logout: function(){
        Mall.request("/api/Logout")
          .always(function(data){
            if( data.error_code == 0 ){
                simpleStorage.set('token', undefined);
                simpleStorage.set('isOauth', undefined);
                window.location.href='/H5/login';
            }
          })
    },
		getInfo: function(){
			Mall.request( "/api/UserInfo" )
				.always( function( data ){
					if( data.error_code == 0 ){
					    member.data = data.data;
                        simpleStorage.set('avatar_url', data.data.avatar_url);
                        member.message = data.data.total_unread;
                        /*if(data.data.vip_level == 0){
                            document.getElementById('qrcode').style.display="none";
                        }*/
                        $( ".content" ).removeClass( "visibility" );
					}
				} )
		}
	});
	member.getInfo();
    var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        //在微信中打开
        document.getElementById('wx_login').style.display="none";
    }else{
        document.getElementById('bind_div').style.display="none";
    }
	avalon.scan( document.body )
</script>
</body>
</html>